Computes the maximum value of a view of elements of a generic type.

Namespace:  C1.LiveLinq
Assembly:  C1.LiveLinq (in C1.LiveLinq.dll)

Syntax

C#
public static AggregationView<TSource, TSource> LiveMax<TSource>(
	this View<TSource> source
)
Visual Basic
<ExtensionAttribute> _
Public Shared Function LiveMax(Of TSource) ( _
	source As View(Of TSource) _
) As AggregationView(Of TSource, TSource)

Parameters

source
Type: C1.LiveLinq.LiveViews..::..View<(Of <(<'TSource>)>)>
A view containing the values to determine the maximum value of.

Type Parameters

TSource
The type of the elements of source.

Return Value

A view representing the maximum of the values.

Remarks

If type TSource implements IComparable<(Of <(<'T>)>)>, this method uses that implementation to compare values. Otherwise, if type TSource implements IComparable, that implementation is used to compare values.

It is possible to use standard LINQ query operator Max instead of LiveMax. Both are "live" in the sense that they are recomputed automatically when any change occurs in the source. The difference is that Max will every time loop through the entire source collection and aggregate it from scratch, whereas LiveMax will use a more performant algorithm, will maintain its value incrementally, processing only those source items that actually changed.

See Also